\hypertarget{class_n_semaphore}{\section{N\+Semaphore类 参考}
\label{class_n_semaphore}\index{N\+Semaphore@{N\+Semaphore}}
}


有名信号量,一般用于进程间通信  




{\ttfamily \#include $<$Semaphore.\+h$>$}

类 N\+Semaphore 继承关系图\+:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{class_n_semaphore}
\end{center}
\end{figure}
\subsection*{Public 成员函数}
\begin{DoxyCompactItemize}
\item 
\hypertarget{class_n_semaphore_aea2a1d431eafa1f10a683fe695b1f53c}{{\bfseries N\+Semaphore} (char $\ast$name)}\label{class_n_semaphore_aea2a1d431eafa1f10a683fe695b1f53c}

\item 
sint32 \hyperlink{class_n_semaphore_a67253f622b2404157b6313d15eec1470}{open} (sint32 value=1)
\begin{DoxyCompactList}\small\item\em 打开有名信号量 \end{DoxyCompactList}\item 
sint32 \hyperlink{class_n_semaphore_a8941ffed3c951d2cc5d6f63b29df3b50}{close} ()
\begin{DoxyCompactList}\small\item\em 关闭有名信号量 \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{额外继承的成员函数}


\subsection{详细描述}
有名信号量,一般用于进程间通信 

\subsection{成员函数说明}
\hypertarget{class_n_semaphore_a8941ffed3c951d2cc5d6f63b29df3b50}{\index{N\+Semaphore@{N\+Semaphore}!close@{close}}
\index{close@{close}!N\+Semaphore@{N\+Semaphore}}
\subsubsection[{close}]{\setlength{\rightskip}{0pt plus 5cm}sint32 N\+Semaphore\+::close (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [virtual]}}}\label{class_n_semaphore_a8941ffed3c951d2cc5d6f63b29df3b50}


关闭有名信号量 


\begin{DoxyParams}{参数}
{\em void} & \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
成功返回\+S\+T\+A\+T\+U\+S\+\_\+\+O\+K,失败返回\+S\+T\+A\+T\+U\+S\+\_\+\+E\+R\+R\+O\+R 
\end{DoxyReturn}
\begin{DoxyNote}{注解}
当信号量不再使用时,请关闭.\+进程退出时也会自动关闭, 但关闭信号量不会真正删除信号量,删除需要使用sem\+\_\+unlink. 
\end{DoxyNote}


实现了 \hyperlink{class_semaphore}{Semaphore}.

\hypertarget{class_n_semaphore_a67253f622b2404157b6313d15eec1470}{\index{N\+Semaphore@{N\+Semaphore}!open@{open}}
\index{open@{open}!N\+Semaphore@{N\+Semaphore}}
\subsubsection[{open}]{\setlength{\rightskip}{0pt plus 5cm}sint32 N\+Semaphore\+::open (
\begin{DoxyParamCaption}
\item[{sint32}]{value = {\ttfamily 1}}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [virtual]}}}\label{class_n_semaphore_a67253f622b2404157b6313d15eec1470}


打开有名信号量 


\begin{DoxyParams}{参数}
{\em void} & \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
成功返回\+S\+T\+A\+T\+U\+S\+\_\+\+O\+K,失败返回\+S\+T\+A\+T\+U\+S\+\_\+\+E\+R\+R\+O\+R 
\end{DoxyReturn}
\begin{DoxyNote}{注解}
信号量存在,则返回,不存在则创建,创建成功生成/tmp/sem.name 
\end{DoxyNote}


实现了 \hyperlink{class_semaphore}{Semaphore}.



该类的文档由以下文件生成\+:\begin{DoxyCompactItemize}
\item 
libemb/inc/\hyperlink{_semaphore_8h}{Semaphore.\+h}\item 
libemb/src/Semaphore.\+cpp\end{DoxyCompactItemize}
